package com.wl.designpattern.interpreter;

/**
 * 终结符表达式
 * Created by wangliang on 2021/2/27.
 */
public class NumExpression extends ArithmeticExpression {//数字表达式，用来解释数字
    private String strNum;

    public NumExpression(String strNum) {
        this.strNum = strNum;
    }

    @Override
    public Integer interpret(Context context) {//解释数字
        return Integer.parseInt(strNum);
    }
}
